home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / s / saucencodeissue3.dms / saucencodeissue3.adf / AMOS_Extension / Misc_Extension.asc < prev   
Text File  |  1996-01-21  |  10KB  |  304 lines

  1. * AMOS Professional Misc Extension
  2. * This file is fully public domain.
  3.  
  4. * Feel free to make a new version!
  5. * Read the manual for more infos.
  6.  
  7. * Written with DevPac 2 by
  8.  
  9. * Frank Otto
  10. * Grelckstr. 27
  11. * 22529 Hamburg
  12. * Germany
  13.  
  14. * E-Mail: FRANK@ZINOCAVE.wind.dbn.sub.org
  15.  
  16.  
  17.  
  18.  
  19. ; half english, half german, that's europe!
  20.  
  21. ExecBase=4
  22. supervisor = -30
  23. Version         MACRO
  24.                 dc.b    "1.0"
  25.                 ENDM
  26. ExtNb           equ     23-1
  27.                 Include "|AMOS_Includes.s"
  28. DLea            MACRO
  29.                 Move.l  Extadr+Extnb*16(a5),\2
  30.                 add.w   #\1-MB,\2
  31.                 ENDM
  32. DLoad           MACRO
  33.                 move.l  Extadr+Extnb*16(a5),\1
  34.                 ENDM
  35. Start           dc.l    C_Tk-C_Off
  36.                 dc.l    C_Lib-C_Tk
  37.                 dc.l    C_Title-C_Lib
  38.                 dc.l    C_End-C_Title
  39.                 dc.w    0
  40. *               Offsets der Befehle
  41. C_Off           dc.w (L1-L0)/2,(L2-L1)/2,(L3-L2)/2,(L4-L3)/2
  42.                 dc.w (L5-L4)/2,(L6-L5)/2,(L7-L6)/2,(L8-L7)/2
  43.                 dc.w (L9-L8)/2,(L10-L9)/2,(L11-L10)/2,(L12-L11)/2
  44.                 dc.w (L13-L12)/2,(L14-L13)/2,(L15-L14)/2
  45. *               Befehlsnamen
  46. C_Tk            dc.w    1,0
  47.                 dc.b    $80,-1
  48.                 
  49.                 dc.w    L_DLedOn,-1
  50.                 dc.b    "dled o",$80+"n","I",-1         ;Fertig
  51.                 
  52.                 dc.w    L_DLedOff,-1
  53.                 dc.b    "dled of",$80+"f","I",-1        ;Fertig
  54.                 
  55.                 dc.w    L_DisplayOn,-1
  56.                 dc.b    "display o",$80+"n","I",-1      ;Fertig
  57.                 
  58.                 dc.w    L_DisplayOff,-1
  59.                 dc.b    "display of",$80+"f","I",-1     ;Fertig
  60.                 
  61.                 dc.w    L_MultiOff,-1
  62.                 dc.b    "multi of",$80+"f","I",-1       ;Fertig
  63.                 
  64.                 dc.w    L_MultiOn,-1
  65.                 dc.b    "multi o",$80+"n","I",-1        ;Fertig
  66.                 
  67.                 dc.w    L_MouseOff,-1
  68.                 dc.b    "mouse of",$80+"f","I",-1       ;Fertig
  69.                 
  70.                 dc.w    L_Reset,-1
  71.                 dc.b    "rese",$80+"t","I",-1           ;Fertig
  72.                 
  73.                 dc.w    L_ClearRam,-1
  74.                 dc.b    "clear ra",$80+"m","I",-1       ;Fertig
  75.                 
  76.                 dc.w    L_DiskWait,-1
  77.                 dc.b    "disk wai",$80+"t","I",-1       ;Fertig
  78.                 
  79.                 dc.w    L_PalOn,-1
  80.                 dc.b    "pal o",$80+"n","I",-1
  81.  
  82.                 dc.w    L_Fire,-1
  83.                 dc.b    "firewai",$80+"t","I",-1
  84.  
  85.                 dc.w    0
  86.  
  87. ******************************************************************
  88. *               Start of library
  89. C_Lib
  90.  
  91. ******************************************************************
  92. *               COLD START
  93. L0      moveq   #ExtNb,d0
  94.         rts
  95.  
  96. ******************************************************************
  97. *
  98. L1
  99.  
  100. ******************************************************************
  101. *       
  102. L2
  103.  
  104. ******************************************************************
  105. L_DisplayOff    equ     3
  106. L3      move.w  #$01a0,$dff096          * Monitor aus
  107.         move.w  #0,$dff180
  108.         rts
  109. ******************************************************************
  110. L_DisplayOn     equ     4
  111. L4      move.w  #$81a0,$dff096          * Monitor an
  112.         rts
  113. ******************************************************************
  114. L_MultiOff      equ     5
  115. L5      movem.l a3-a6,-(sp)             * Multitasking aus
  116.         move.l  4,a6
  117.         jsr     -132(a6)
  118.         movem.l (sp)+,a3-a6
  119.         rts
  120. ******************************************************************
  121. L_MultiOn       equ     6
  122. L6      movem.l a3-a6,-(sp)             * Multitasking an
  123.         move.l  4,a6
  124.         jsr     -138(a6)
  125.         movem.l (sp)+,a3-a6
  126.         rts
  127. ******************************************************************
  128. L_DLedOn        equ     7
  129. L7      move.b  #127,$bfd100            ; Laufwerk-LED an
  130.         move.b  #119,$bfd100
  131.         move.b  #0,$bfd100+512
  132.         rts                             
  133. ******************************************************************
  134. L_DLedOff       equ     8
  135. L8      move.b  #127,$bfd100            ; Laufwerk-LED aus
  136.         move.b  #119,$bfd100
  137.         move.b  #255,$bfd100+512
  138.         rts
  139. ******************************************************************
  140. L_MouseOff      equ     9
  141. L9      move.w  #$20,$dff096            ; Mouse aus
  142.         rts
  143. ******************************************************************
  144. CuCuOff dc.b    27,"C0",0
  145.         even
  146. ******************************************************************
  147. L_Reset         equ     10
  148. L10     MOVEA.L 4.W,A6
  149.         JSR     -$0096(A6)
  150.         JSR     -$0078(A6)              ; Reset
  151.         CLR.L   4.W
  152.         LEA     $00FC0000.L,A0
  153.         RESET   
  154.         JMP     (A0)
  155.         DC.B    'Nq'
  156.         rts
  157. ******************************************************************      
  158. L_ClearRam     equ      11
  159. L11     movem.l         a6,-(sp)        ; No Drivers
  160.         move.l          4,a6
  161.         moveq           #0,d1
  162.         move.l          #99999999,d0
  163.         jsr             -198(a6)
  164.         move.l          d0,a0
  165.         beq.s           glbl
  166.         jsr             -210(a6)
  167. glbl    movem.l         (sp)+,a6
  168.         rts
  169. ******************************************************************
  170. L_Fire          equ     12
  171. L12     btst    #07,$bfe001
  172.         bne     L12
  173.         rts
  174. *****************************************************************
  175. L_DiskWait      equ     13
  176. L13
  177. dc:     move.b  $bfe001,d0              ; Diskchange
  178.         and.b   #16,d0
  179.         bne     dc
  180.         movem.l a6,-(sp)
  181.         movea.l 4,a6
  182. Wait    move.l  #500,d1
  183. Wait2   bsr     tests
  184.         sub.l   #1,d1
  185.         bne     Wait2
  186.         jsr     -120(a6)
  187.         lea     $196(a6),a0
  188.         lea     Validate,a1
  189.         jsr     -276(a6)
  190.         move.l  d0,d2
  191.         bne     Check
  192.         lea     $1a4(a6),a0
  193.         lea     Validate,a1
  194.         jsr     -276(a6)
  195.         move.l  d0,d2
  196. Check   jsr     -126(a6)
  197.         tst.l   d2
  198.         bne     Wait
  199.         movem.l (sp)+,a6
  200.         rts
  201. tests   movem.l a0-a6/d0-d7,-(sp)
  202.         movem.l (sp)+,a0-a6/d0-d7
  203.         rts
  204. Validate:
  205.         dc.b    'Validator',0
  206.         even
  207. **********************************************************************
  208. L_PalOn equ     14
  209. L14
  210.  
  211. Flag_60Hz               RS.B    1
  212. Flag_Color              RS.B    1
  213. Flag_OverScan           RS.B    1
  214. Flag_Enable             RS.B    1
  215. Flag_FatAgnus           RS.B    1
  216. Flag_Resident           RS.B    1
  217. gb_DisplayFlags         EQU     206     ;graphics
  218. gb_DisplayRows          EQU     212
  219. gb_NormalDisplayRows    EQU     216
  220. VBlankFrequency         EQU     530
  221. _LVOCloseLibraryP       EQU     -414
  222. _LVOSumLibraryP         EQU     -426
  223. _LVOOpenLibraryP        EQU     -552
  224. Exebas                  EQU     $4
  225. LIBF_CHANGED            EQU     2
  226. LIB_FLAGS               EQU     14
  227. BEAMCON0                EQU     $1DC
  228. CUSTOM                  EQU     $DFF000
  229. CALL            MACRO
  230.                 IFC     'EXEC','\1'
  231.                 MOVEA.L (Exebas).W,A6
  232.                 ENDC
  233.                 IFNC    'EXEC','\1'
  234.                 MOVEA.L \1Base,A6
  235.                 ENDC
  236.                 JSR     _LVO\2(A6)
  237.                 ENDM
  238.  
  239. OPENLIB         MACRO
  240.                 LEA     \1Name(PC),A1
  241.                 CLR.L   D0
  242.                 CALL    EXEC,OpenLibraryP
  243.                 MOVE.L  D0,\1Base
  244.                 BEQ     \2
  245.                 ENDM
  246. CLOSELIB        MACRO
  247.                 MOVEA.L \1Base,A1
  248.                 CALL    EXEC,CloseLibraryP
  249.                 ENDM
  250. Go60            tst.b   Flag_FatAgnus(a0)       ;put system in NTSC mode
  251.                 beq.s   .NoFatty
  252.                 move.w  #$0000,BEAMCON0!CUSTOM  ;to NTSC please
  253.                 bra.s   .Go60
  254. .NoFatty        move.w  #$0000,BEAMCON0!CUSTOM
  255.                 bne.s   .Error                  ;not available
  256. .Go60           lea     GFXName(PC),a1          ;modify graphics.library
  257.                 clr.l   d0
  258.                 CALL    EXEC,OpenLibraryP
  259.                 move.l  d0,a1
  260.                 move.w  gb_DisplayFlags(a1),d0
  261.                 and.b   #%11111011,d0
  262.                 or.b    #%00000001,d0
  263.                 move.w  d0,gb_DisplayFlags(a1)
  264.                 move.w  #200,gb_NormalDisplayRows(a1)
  265.                 move.w  #262,gb_DisplayRows(a1)
  266.                 or.b    #LIBF_CHANGED,LIB_FLAGS(a1)
  267.                 movea.l a1,a2
  268.                 CALL    EXEC,SumLibraryP
  269.                 movea.l a2,a1
  270.                 CALL    EXEC,CloseLibraryP
  271.                 move.b  #60,VBlankFrequency(a6)
  272.                 or.b    #LIBF_CHANGED,LIB_FLAGS(a6)
  273.                 CALL    EXEC,SumLibraryP
  274.                 lea     Flags(pc),a0
  275.                 st      Flag_Enable(a0)         ;start it
  276.                 moveq   #0,d0
  277.                 rts
  278. .Error          lea     Flags(pc),a0
  279.                 st      Flag_60Hz(a0)
  280.                 sf      Flag_Enable(a0)         ;stop it
  281.                 moveq   #-1,d0
  282.                 rts
  283. GFXName         DC.B    "graphics.library",$0
  284.                 EVEN
  285. Flags           DCB.B   8
  286.                 rts
  287. ************************************************
  288. L15
  289.  
  290.  
  291. *               Welcome message                     ;"  
  292. C_Title:        
  293.         dc.b    "AMOSPro Misc Extension V"
  294.         Version
  295.         dc.b    " by Frank Otto (1995)"
  296.         dc.b    0,"$VER: "
  297.         Version
  298.         dc.b    0
  299.         Even
  300.  
  301. ***********************************************************
  302. C_End:  dc.w    0
  303.         even
  304.